package com.martin.dms.services;

import java.util.List;

import com.martin.dms.model.Supplier;

/**
 * Service that manages the supplier entity.
 * 
 * @author mtsvetkov
 */
public interface SupplierService {

    /**
     * Searches for suppliers that match the three filters.
     * 
     * @param nameFilter - filter for the name of the supplier.
     * @param emailFilter - filter for the email of the supplier.
     * @param suppliedItemNameFilter - filter for the name of a supplied item.
     * @return a list with all found suppliers.
     */
    public List<Supplier> findByNameEmailAndSuppliedItemName(String nameFilter, String emailFilter,
            String suppliedItemNameFilter);

    /**
     * Retrieves the supplier with the specified id.
     * 
     * @param id - the id of the supplier.
     * @return a <code>Supplier</code>.
     */
    public Supplier get(long id);

    /**
     * Deletes the supplier with the specified id.
     * 
     * @param id - the id of the supplier.
     */
    public void delete(long id);

    /**
     * Creates a new supplier.
     * 
     * @param name - the name of the supplier.
     * @param email - the email of the supplier.
     * @param address - the address of the supplier.
     * @param phoneNumber - the phone number of the supplier.
     * @param itemIds - the ids of the supplied items.
     */
    public void create(String name, String email, String address, String phoneNumber, List<Long> itemIds);

    /**
     * Updates an existing supplier.
     * 
     * @param id - the id of the supplier.
     * @param name - the name of the supplier.
     * @param email - the email of the supplier.
     * @param address - the address of the supplier.
     * @param phoneNumber - the phone number of the supplier.
     * @param itemIds - the ids of the supplied items.
     */
    public void update(long id, String name, String email, String address, String phoneNumber, List<Long> itemIds);
}
